<%@ page language="java" contentType="text/html; charset=utf-8"%>
<%@taglib prefix="s" uri="/struts-tags" %>
<%
String basePath = request.getContextPath();
%>
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>订单价格批量更新</title>
		
		<link rel="stylesheet" href="<%=basePath %>/css/style.css" type="text/css" media="screen" />
		<script type="text/javascript" src="<%=basePath %>/js/validator.js"></script>
		<script type='text/javascript' src='<%=basePath %>/js/jquery1.3.2/js/jquery-1.3.2.min.js'></script>
		<script type='text/javascript' src='<%=basePath %>/js/jquery1.3.2/js/jquery.form.js'></script>
		<style type="text/css">
		<!--
		body {
			text-align: center;
			margin-top: 10px;
		}
		td{text-align:center;}
		input{text-align:center;}
		-->
		</style>
		<script language="javascript">
			function submitForm(){
				if(Validator.Validate(document.getElementById("theForm"),2)){
					var options = {
						success:function(data){
							if(data.success){
								alert("操作成功！");
								try{
									window.parent.OrderInfoView.reloadData();
								}catch(e){};
								try{
									window.parent.win.close();
								}catch(e){};
							}else{
								alert("第" + data.rows + "行出现错误，请检查后再更新");
							}
						},
						dataType:"json"
					}; 
					$('#theForm').ajaxForm(options).submit();				
				}
			}
		</script>
	</head>
	<body>
		<form name="theForm" id="theForm"  action="<%=basePath %>/order/batchUpdatePriceOrderInfo.do" method="post">
		<table id="edittable" border="0" cellspacing="0" cellpadding="3" width="90%">
			<tr class="head">
			   <th>
					序号
				</th>
				<th>
					订单号
				</th>
				<th>
					购买人
				</th>
				<th>
					体检人
				</th>
				<th>
					成交价格
				</th>
				<th>
					结算价格
				</th>
			</tr>
			<s:iterator value="orderInfoList" status="li">
				<tr>
					<td>
						<s:property value='#li.count'/><input  name="id_<s:property value='#li.count'/>" type="hidden" value="<s:property value="id" />"/>
					</td>
					<td>
						<s:property value="orderNo"/>
					</td>
					<td>
						<s:property value="buyUser"/>
					</td>
					<td>
						<s:property value="tijian"/>
					</td>
					<td>
						<input size="8"  name="salePrice_<s:property value='#li.count'/>" type="text" value="<s:property value="salePrice" />" datatype="Integer" msg="成交价格不能为空且只能为整数"/>
					</td>
					<td>
						<input size="8" name="basePrice_<s:property value='#li.count'/>"  type="text" value="<s:property value="basePrice" />" datatype="Integer" msg="结算价格不能为空且只能为整数"/>
					</td>
				</tr>
			</s:iterator>
				<tr>
					<td colspan="7">
						<input name="Submit" type="button" onclick="submitForm()" value="提交"/>
						<input name="reset" type="reset" id="reset" value="重置" />
						<input name="orderInfoSize" type="hidden" value="<s:property value="orderInfoList.size" />"/>
		  	 		</td>
				</tr>
		</table>
		</form>
	</body>
</html>
